Skip to content

[docs] Document that undo recovery rolls back other writers' changes - #5331

Merged
platinumhamburg merged 7 commits into
apache:mainfrom
mcgrj:docs-agg-undo-single-writer
Nov 26, 2026
Merged

platinumhamburg merged 7 commits into
apache:mainfrom
mcgrj:docs-agg-undo-single-writer

Conversation

@mcgrj

@mcgrj mcgrj commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Generative AI disclosure: Yes. Drafted with Grok Bot (AI assistant); reviewed and revised by @mcgrj.
Revision drafted with OpenAI Codex.
Generated-by: Grok Bot and OpenAI Codex following the guidelines

Purpose

Linked issue: Part of #5330

Document how restoring a Flink job that writes full rows can undo other writers' changes in the same bucket.

Brief change log

Explain the recovery window, show how restoring a checkpoint can delete a key inserted by another writer, and clarify support for explicit partial updates to disjoint non-key columns.

Tests

Docs-only change. Before this wording revision, the website build (./build_versioned_docs.sh, ./setup_blog.sh, npm run build -- --no-minify) passed locally. Pre-existing broken anchors remain; none are on the changed page.

API and Format

No API or storage format change.

Documentation

This updates the existing aggregation merge engine documentation. It does not close #5330.


### Single Writer with Flink

A Flink job writing an aggregation table must be the table's only writer. On recovery, the job rolls back every change in each bucket since its last checkpointed write, including changes from other jobs or clients. Partitions created after the checkpoint are rolled back in full.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we need a “Single Writer with Flink” section. Aggregataion table is the same as regular primary-key tables, two Flink jobs can use partial updates to write the same key concurrently if they explicitly target disjoint non-key columns. FIP-21 assumes this case, and the recovery test checks that rolling back price preserves the other writer's update to stock. FIP-21, section 3 · Recovery test

Even on a regular primary-key table, two independent jobs writing the same column have no guaranteed write order and is not supported. If one writes (id=1, v=10) and the other writes (id=1, v=11), both writes can be acknowledged. The final value can be 10 or 11, depending on which write Fluss applies last.

cc @platinumhamburg what do you think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @wuchong. Let’s document the undo recovery behavior for full-row writes, as shown in #5330. Multiple Flink jobs can still use explicit partial updates on the same key when their non-key target columns don’t overlap. A table-wide single-writer requirement would rule out that supported case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @wuchong @platinumhamburg for your review, updated PR accordingly 🙏

@mcgrj

mcgrj commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Hi @wuchong @platinumhamburg - If you are happy with this doc submission, are you happy with the proposed rough approach for underlying issue in #5330 to be tackled as follow-up?

@platinumhamburg platinumhamburg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mcgrj for adding these explanations. The examples make the recovery behavior clear. Could we consider opening Exactly-Once Semantics with one sentence summarizing the conditions from FIP-21? For example:

Flink provides exactly-once writes to an aggregation table when a single Flink job is the only writer, or when multiple Flink jobs use explicit partial updates on non-overlapping sets of non-primary-key columns.

This would help readers immediately determine whether the guarantee applies to their setup, with the following examples explaining the implications. Currently, the general rule appears after the examples, so readers need to infer the conditions from the recovery behavior. Stating the rule first would make this section easier to follow.

@mcgrj

mcgrj commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @platinumhamburg, sounds good to me - I've made the requested addition for your review.

@platinumhamburg
platinumhamburg merged commit 2a0bc98 into apache:main Nov 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[flink] Undo recovery deletes or reverts rows written by other clients to an aggregation table

3 participants